﻿<!--
    Copyright (c) 2012 Nokia Corporation.
-->
<phone:PhoneApplicationPage
    x:Class="Compass.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"
    xmlns:src="clr-namespace:Compass.Ui"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"
          Background="Transparent">
        <!-- Map control -->
        <maps:Map x:Name="MyMap"
                  Center="65, 24.5"
                  ZoomLevel="5"
                  ZoomLevelChanged="OnMapZoomLevelChanged" />
        
        <TextBlock x:Name="DebugTextBlock"
                   Margin="10, 10, 10, 10"
                   Width="480"
                   Height="400"
                   Text="DEBUG BOX"
                   Foreground="#000000"
                   />
                   
        <!-- Compass control is the visible compass item -->
        <src:CompassControl x:Name="CompassControl"
                            Width="{Binding ElementName=CompassControl, Path=PlateWidth}"
                            Height="{Binding ElementName=CompassControl, Path=PlateHeight}"
                            />

        <!--Location panel is shown at application startup 
            asking for permission to location data.-->
        <Grid x:Name="LocationPanel" Margin="0, 0, 0, 0" Grid.RowSpan="2" Background="#333333">
            <StackPanel Grid.Row="1" Margin="12, 62, 12, 0">
                <TextBlock Margin="12, 0, 12, 0" Text="{Binding Path=LocalizedResources.LocationUsageQueryText, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextTitle2Style}" TextWrapping="Wrap"/>
                <TextBlock Margin="12, 10, 12, 0" Text="{Binding Path=LocalizedResources.LocationUsageInfoText, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom">
                <Button x:Name="AllowButton" Content="{Binding Path=LocalizedResources.LocationAllowButtonText, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Left" Width="200" Click="LocationUsage_Click"/>
                <Button x:Name="CancelButton" Content="{Binding Path=LocalizedResources.LocationCancelButtonText, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Right" Width="200" Click="LocationUsage_Click"/>
            </StackPanel>
        </Grid>
        
        <!--Uncomment to see an alignment grid to help ensure your controls are
            aligned on common boundaries.  The image has a top margin of -32px to
            account for the System Tray. Set this to 0 (or remove the margin altogether)
            if the System Tray is hidden.

            Before shipping remove this XAML and the image itself.-->
        <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
    </Grid>

</phone:PhoneApplicationPage>